<template>
  <el-switch v-model="modelValue" />
</template>

<script setup lang="ts">
import { computed } from "vue";
import { FormField } from "../utils";

interface Props {
  modelValue: boolean;
  field: FormField;
}

interface Emits {
  (e: "update:modelValue", value: boolean): void;
}

const props = defineProps<Props>();
const emit = defineEmits<Emits>();

const modelValue = computed({
  get: () => props.modelValue,
  set: value => emit("update:modelValue", value)
});
</script>
